package com.xbongbong.saas.domain.entity;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author lee
 * @date  2020-01-10 10:58
 **/
@Getter
@Setter
@ToString
public class StockFlowBillEntity implements Serializable{

    private static final long serialVersionUID = 2436013807285057490L;

    /**
     * 主键
     *
     */
    private Long id;
    /**
     * 公司id
     *
     */
    private String corpid;
    /**
     * 仓库id
     *
     */
    private Long warehouseId;
    /**
     *
     * 关联单据id
     *
     */
    private Long refId;

    private Long refProductId;
    /**
     *
     * 库存变化类型
     *
     */
    private Integer stockType;
    /**
     *
     * 产品id
     *
     */
    private Long productId;
    /**
     *
     * 单据编号
     *
     */
    private String refSheetNo;
    /**
     *
     * 往来单位id
     *
     */
    private Long businessId;
    /**
     *
     * 往来单位名称
     *
     */
    private String businessName;
    /**
     *
     * 出入库数量
     *
     */
    private Double num;

    /**
     *
     * 出入库单的产品成本
     *
     */
    private Double productCost;

    /**
     *
     * 结存总库存
     *
     */
    private Double remainingStock;

    /**
     *
     * 结存总成本
     *
     */
    private Double remainingCost;

    /**
     *
     * 流水发生时间
     *
     */
    private Long date;

    /**
     *
     * 业务类型
     *
     */
    private Integer businessType;

    /**
     *
     * product_warehouse唯一key
     *
     */
    private String warehouseKey;

    private String memo;

    /**
     *
     * 添加时间
     *
     */
    private Long addTime;
    /**
     *
     * 更新时间
     *
     */
    private Long updateTime;
    /**
     *
     * 删除标志
     *
     */
    private Integer del;

    public StockFlowBillEntity(String corpid, Long warehouseId, Long refId, Long refProductId, Integer stockType, Long productId, String refSheetNo, Long businessId, String businessName, Double num, Double productCost, Double remainingStock, Double remainingCost, Long date, Integer businessType, String warehouseKey, String memo) {
        this.corpid = corpid;
        this.warehouseId = warehouseId;
        this.refId = refId;
        this.refProductId = refProductId;
        this.stockType = stockType;
        this.productId = productId;
        this.refSheetNo = refSheetNo;
        this.businessId = businessId;
        this.businessName = businessName;
        this.num = num;
        this.productCost = productCost;
        this.remainingStock = remainingStock;
        this.remainingCost = remainingCost;
        this.date = date;
        this.businessType = businessType;
        this.warehouseKey = warehouseKey;
        this.memo = memo;
        this.del = DelEnum.NORMAL.getDel();
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
    }

    public StockFlowBillEntity(String corpid, Long warehouseId, Long refId, Long refProductId, Integer stockType, Long productId, String refSheetNo, Long businessId, String businessName, Double num, Double productCost, Double remainingStock, Double remainingCost, Long date, Integer businessType, String warehouseKey, String memo, Long addTime) {
        this.corpid = corpid;
        this.warehouseId = warehouseId;
        this.refId = refId;
        this.refProductId = refProductId;
        this.stockType = stockType;
        this.productId = productId;
        this.refSheetNo = refSheetNo;
        this.businessId = businessId;
        this.businessName = businessName;
        this.num = num;
        this.productCost = productCost;
        this.remainingStock = remainingStock;
        this.remainingCost = remainingCost;
        this.date = date;
        this.businessType = businessType;
        this.warehouseKey = warehouseKey;
        this.memo = memo;
        this.del = DelEnum.NORMAL.getDel();
        this.addTime = addTime;
        this.updateTime = DateTimeUtil.getInt();
    }

    public StockFlowBillEntity() {
        this.del = DelEnum.NORMAL.getDel();
    }
}
